package com.yanqu.road.server.cmd.activity.dunhuangshiku;

import com.yanqu.road.pb.dunhuangshiku.DunHuangShiKuProto;
import com.yanqu.road.pb.worldmessage.WorldMessageProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cross.battle.dunhuangshiku.DunHuangShiKuMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @Author cwq
 * @Date 2021/04/20
 */

@Cmd(code = CrossProtocol.C2_DUN_HUANG_SHI_KU_TEAM_CHAT, desc = "敦煌石窟队伍发送聊天")
public class CrossDunHuangShiKuTeamChatCmd extends CrossUnionCommand {

    int activityId;
    WorldMessageProto.WorldMessageTempMsg chatMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        DunHuangShiKuProto.DunHuangShiKuTeamChatReqMsg msg = DunHuangShiKuProto.DunHuangShiKuTeamChatReqMsg.parseFrom(packet.getBytes());
        activityId = msg.getActivityId();
        chatMsg = msg.getMsg();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        DunHuangShiKuMgr.teamChat(activityId, chatMsg);
    }

    @Override
    public void sendData() {

    }
}
